package com.dsr.controller;

import com.dsr.consts.Result;

import com.dsr.util.BasicUtil;
import com.dsr.util.FileUtil;
import com.dsr.util.UploadUtil;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.*;
import java.sql.Blob;
import java.util.Base64;
import java.util.Map;

/**
 * @author dsr
 * @date 2020-06-27
 **/

@RestController
public class UploadController {

    @Resource
    private FileUtil fileUtil;
    @RequestMapping("/upload/file")
    public Result upload(MultipartFile file) throws Exception {

        return Result.success((Object)fileUtil.uploadFiles(file));
    }

}
